class MyContext:
    def __enter__(self):
        print("Entering the context")
        return "some value"

    def __exit__(self, exc_type, exc_val, exc_tb):
        print("Exiting the context")
        return False  # 不抑制异常


with MyContext() as value:
    print(f"Inside context, got: {value}")
